<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			[v-cloak]{
				display: none;
			}
		</style>
	</head>
	<body>
		<h1>Axios</h1>
		<div id="aa2">
			<h3 v-for="i in users" v-cloak>{{i}}</h3>
		</div>
		<script src="../js/axios.js"></script>
		<script src="../vue.js"></script>
		<script>
			axios.defaults.baseURL = "http://localhost:8090/user"
			let user = {
				name: 'WDNMD',
				age: 10,
				sex: '未知'
			}
			// axios.post("/saveUser", user)
			// 	 .then((res6) => {
			// 		 // console.log(res2.data)
					 
					//  const a = new Vue({
					// 	 el: "#aa2",
					// 	 data: {
					// 		 users: res6.data
					// 	 }
					//  })
				 // })
			async function ajax(){
				let {data: val} = await axios.post("/saveUser", user)
				const a = new Vue({
					el: "#aa2",
						data: {
							users: val
						}
					})
			}
			ajax()

		</script>
	</body>
</html>
